/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.guet.careapp.pojo;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author LXM
 */
@Entity
@Table(name = "t_instruction")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TInstruction.findAll", query = "SELECT t FROM TInstruction t"),
    @NamedQuery(name = "TInstruction.findById", query = "SELECT t FROM TInstruction t WHERE t.id = :id"),
    @NamedQuery(name = "TInstruction.findByPara", query = "SELECT t FROM TInstruction t WHERE t.para = :para"),
    @NamedQuery(name = "TInstruction.findByExcuation", query = "SELECT t FROM TInstruction t WHERE t.excuation = :excuation"),
    @NamedQuery(name = "TInstruction.findByCreateTime", query = "SELECT t FROM TInstruction t WHERE t.createTime = :createTime"),
    @NamedQuery(name = "TInstruction.findByExcuationTime", query = "SELECT t FROM TInstruction t WHERE t.excuationTime = :excuationTime")})
public class TInstruction implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Size(max = 255)
    @Column(name = "para")
    private String para;
    @Column(name = "excuation")
    private Integer excuation;
    @Column(name = "create_time")
    private BigInteger createTime;
    @Column(name = "excuation_time")
    private BigInteger excuationTime;
    @JoinColumn(name = "g_info_id", referencedColumnName = "u_id")
    @ManyToOne(optional = false)
    private TUserGuardianInfo gInfoId;
    @JoinColumn(name = "ug_info_id", referencedColumnName = "u_id")
    @ManyToOne(optional = false)
    private TUserUnderGuardiansInfo ugInfoId;

    public TInstruction() {
    }

    public TInstruction(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getPara() {
        return para;
    }

    public void setPara(String para) {
        this.para = para;
    }

    public Integer getExcuation() {
        return excuation;
    }

    public void setExcuation(Integer excuation) {
        this.excuation = excuation;
    }

    public BigInteger getCreateTime() {
        return createTime;
    }

    public void setCreateTime(BigInteger createTime) {
        this.createTime = createTime;
    }

    public BigInteger getExcuationTime() {
        return excuationTime;
    }

    public void setExcuationTime(BigInteger excuationTime) {
        this.excuationTime = excuationTime;
    }

    public TUserGuardianInfo getGInfoId() {
        return gInfoId;
    }

    public void setGInfoId(TUserGuardianInfo gInfoId) {
        this.gInfoId = gInfoId;
    }

    public TUserUnderGuardiansInfo getUgInfoId() {
        return ugInfoId;
    }

    public void setUgInfoId(TUserUnderGuardiansInfo ugInfoId) {
        this.ugInfoId = ugInfoId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TInstruction)) {
            return false;
        }
        TInstruction other = (TInstruction) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pojo.TInstruction[ id=" + id + " ]";
    }

}
